const path = require("path");

module.exports = {
    mode: "development",
    // 入口
    entry: "./src/entries/index.js",
    // 出口
    output: {
        filename: "./v1.1.js"
    },
    // 模块
    module: {
        // 规则
        rules: [
            {
                test: /\.js$/,
                use: [{
                    loader: "babel-loader",
                    options: {
                        "presets": ["es2015"]
                    }
                }],
                include: __dirname
            }
        ]
    },
    // 配置模块如何解析
    // https://webpack.docschina.org/configuration/resolve/#root
    resolve: {
        // 告诉 webpack 解析模块时应该搜索的目录
        modules: [
            // 告诉 webpack 先从 src目录开始搜索
            path.resolve("./src")
        ]
    }
}
